#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDebug>
#include "parameter/seatdetection.h"
#include "dialog/defectdetectiondialog.h"

#define IMAGE_WIDTH 5496
#define IMAGE_HEIGHT 3672
#define USE_CUDA false //use opencv-cuda

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButtonRun_clicked();

    void on_pushButtonTest_clicked();

    void on_pushButtonParameter_clicked();

private:
    SeatDetection               m_objSeatDetection;
    DefectDetectionDialog       *m_pDefectDetectionDialog;

public:
    SeatDetection*              GetSeatDetection(){return &m_objSeatDetection;}

private:
    int                     m_nImageWidth,m_nImageHeight,m_nImageChannel;
    char*                   m_pImageSrcBuffer;
    char*                   m_pImageDestBuffer;
    void                    AllocImageBuffer();
    void                    FreeImageBuffer();

public:
    char*                   GetImageSrcBuffer(int index);
    char*                   GetImageDestBuffer(int index);

public:
    static MainWindow*          instance();

private:
    static MainWindow*          _instance;


private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
